﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using GeoBox.Database;

namespace GeoBox.AzureWeb.Controllers
{
    public class GpsPointController : Controller
    {
        private GpsBoxEntities db = new GpsBoxEntities();
        
        public ActionResult Index()
        {
            var gpspoints = db.GpsPoints.Include(g => g.Device).OrderByDescending(x => x.UtcTime);
            return View(gpspoints.OrderByDescending(x => x.UtcTime).ToList());
        }

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }
    }
}